package com.zelin.yang.kotlin_demo.page

import com.zelin.yang.kotlin_demo.Base.BaseFragment
import com.zelin.yang.kotlin_demo.R
import com.zelin.yang.kotlin_demo.util.SpUtil
import com.zelin.yang.kotlin_demo.util.ToastUtil
import kotlinx.android.synthetic.main.my_fragment.*

class MyFragment: BaseFragment() {

    override fun onResume() {
        super.onResume()
        tv_name.text = SpUtil.getUsername()
    }

    override fun getLayoutId(): Int {
        return R.layout.my_fragment
    }

    override fun Initview() {
        tv_name.setOnClickListener {
            ToastUtil.showToast(mContext,SpUtil.getUsername())
            if(SpUtil.getUsername() == "登录"){
                LoginActivity.start(mContext)
            }
        }
    }

    override fun initDate() {

    }
}